<%@ page contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>重庆邮电大学移通学院宿舍管理系统—注册</title>
<link
	href="${pageContext.request.contextPath}/bootstrap/2.1.1/css/bootstrap.min.css"
	type="text/css" rel="stylesheet" />
<link href="${pageContext.request.contextPath}/css/default.css"
	type="text/css" rel="stylesheet" />
<!-- 引入javascript验证框架的js库文件 -->
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/validate.js"></script>
<!-- 引入jquery框架的js库文件 -->
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-1.8.2.js"></script>
</head>
<script language="javascript">
	$(function() {
		$('#loginName').blur(function() {
			var url = '${pageContext.request.contextPath}/checkLoginName?loginName='
									+ $('#loginName').val();
							$.get(url, function(result) {
								if (result == "true") {
									$('#divLoginName').removeClass('success')
											.addClass('error');
									$('#errorLoginName').html('该登录名已存在');
									$('#submit_btn').attr('disabled', true);
								} else {
									$('#divLoginName').removeClass('error')
											.addClass('success');
									$('#errorLoginName').html('该登录名可以使用');
									$('#submit_btn').attr('disabled', false);
								}
							});
						});
	})
</script>
<body>
	<div id="container">
		<div id="header">
			<img alt="" src="${pageContext.request.contextPath}/img/logo.jpg">
		</div>
		<div id="mainContent">
			<form id="registerForm"
				action="${pageContext.request.contextPath}/register" method="post"
				class="form-horizontal">
				<fieldset>
					<legend>
						<small>用户注册</small>
					</legend>
					<div id="msgs"></div>
						<s:actionerror cssClass="alert alert-error" />
						
						<div class="controls" id="loginId">
							<input type="text" id="loginName" value="${param.loginName}"
								style="color: #999; display: none;" /> <input type="text"
								name="user" value="" id="user" class="input_kuang item errortip"
								placeholder="登录名" isRequired="true"
								rule="(^[\w.\-]+@(?:[a-z0-9]+(?:-[a-z0-9]+)*\.)+[a-z]{2,3}$)|(^1[3|4|5|8]\d{9}$)|(^\d{3,}$)|(^\++\d{2,})"
								autocomplete="off" />
						</div><br><br>
						
						<div class="controls" id="loginId">
							<input type="text" id="loginName" value="${param.loginName}"
								style="color: #999; display: none;" /> <input type="text"
								name="user" value="" id="user" class="input_kuang item errortip"
								placeholder="用户名" isRequired="true"
								rule="(^[\w.\-]+@(?:[a-z0-9]+(?:-[a-z0-9]+)*\.)+[a-z]{2,3}$)|(^1[3|4|5|8]\d{9}$)|(^\d{3,}$)|(^\++\d{2,})"
								autocomplete="off" />
						</div><br><br>
						<div class="controls">
							<input type="password" id="pwd_ph" value="密码"
								class="input_kuang item errortip"
								style="color: #999; display: none;" /> <input type="password"
								name="user.password" class="input_kuang item errortip" id="pwd"
								placeholder="密码" isRequired="true" autocomplete="off" />
						</div><br><br>
						
						<div class="controls">
							<input type="password" id="pwd_ph" value="密码"
								class="input_kuang item errortip"
								style="color: #999; display: none;" /> <input type="password"
								name="user.password" class="input_kuang item errortip" id="pwd"
								placeholder="确定密码" isRequired="true" autocomplete="off" />
						</div><br><br>

						<div class="controls">
							<input id="submit_btn" class="btn btn-primary" type="submit"
								value="提交" /> 
								<input type="button" value="返回" id="cancel_btn" class="btn">
						</div>
				</fieldset>
			</form>
		</div>
        <div id="footer">
	    <p>
	       Copyright © 重庆邮电大学移通学院 2012, All Rights Reserved 
	       </p>
            <p>
             推荐使用IE7.0以上浏览器，1024*768分辨率访问本网站
            </p>
	    </div>
	</div>
	<!-- 引入验证规则及处理方法的js,该文件必须位于待验证表单后,建议放置在</body>前一行(仅使用validatejs框架时适用) -->
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/js/user/register.js"></script>
</body>
</html>
